﻿using System.ComponentModel;


namespace Ops.Mpc.Wcf
{
    public class AsyncCompletedEventArgs<T> : AsyncCompletedEventArgs where T : class
    {

        private object[] results;

        public AsyncCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
            base(exception, cancelled, userState)
        {
            this.results = results;
        }

        public T Result
        {
            get
            {
                base.RaiseExceptionIfNecessary();
                return ((T)(this.results[0]));
            }
        }
    }

}
